<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>用戶列表</title>
<script src="js/jquery-1.7.1.min.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
	$(document).ready(function() {
		getList();
	});

	function getList() {
		var url = "getUserList";
		$.getJSON(url, null, function callback(data) {
			$.each(data, function(i, n) {
				var row = $("#template").clone();
				row.find("#userId").text(n.userid);
				row.find("#userName").text(n.name);
				row.find("#registerDate").text(n.createDate);
				row.find("#type").text(n.type);
				$("#datas").append(row);
			});
		});
	}
</script>
</head>

<body>
	<div>


		<table id="datas" border="1" cellspacing="0"
			style="border-collapse: collapse">
			<tr>
				<th>用户ID</th>
				<th>用户名</th>
				<th>注册时间</th>
				<th>类型</th>
			</tr>
			<tr id="template">
				<td id="userId"></td>
				<td id="userName"></td>
				<td id="registerDate"></td>
				<td id="type"></td>
			</tr>
		</table>
	</div>
</body>
</html>